import random

all_choice = ['石头', '剪刀', '布']
win_list = [['石头', '剪刀'], ['剪刀', '布'], ['布', '石头']]
money = 50
prompt = """*********************
(0) 石头
(1) 剪刀
(2) 布
********************
请出拳（石头/剪刀/布）:
"""
player_win = 0  # 人赢的次数
pc_win = 0  # 计算机赢的次数
while money > 0:
    money -= 5
    pc = random.choice(all_choice)
    ind = int(input(prompt))
    player = all_choice[ind]

    print("你出的拳是：%s,计算机出的拳是： %s" % (player, pc))
    if player == pc:
        print('\033[32m平局\033[0m')
    elif [player, pc] in win_list:
        print('\033[32m你赢了\033[0m')
        money += 10
    else:
        print('\033[31m你输了\033[0m')
        money -= 5
    print("你当前还金币：%d个" % money)
    jx = input("是否继续？（1：是|0：不）：")
    print("*" * 20)
    if jx == 0:
        print('当前金币不足')
        exit()
    if money >= 100:
        print('\033[32m你赢了\033[0m')
print('计科1814-39-易芳')
